package base

import "fmt"

func Test5_001() {
	type person struct {
		name string
		age  int
	}

	var P person                                     // P现在就是person类型的变量了
	P.name = "Astaxie"                               // 赋值"Astaxie"给P的name属性.
	P.age = 25                                       // 赋值"25"给变量P的age属性
	fmt.Printf("The person's name is %s \n", P.name) // 访问P的name属性.

	fmt.Println(P)

	P2 := person{"Tom", 23}
	fmt.Println(P2)

	P3 := person{age: 24, name: "Tom"}
	fmt.Println(P3)

	P4 := new(person) //此处P的类型为*person
	fmt.Println(P4)
}

func Test5_002() {

}
func Test5_003() {

}
func Test5_004() {

}
func Test5_005() {

}
func Test5_006() {

}
func Test5_007() {

}
